import request from '@/utils/request'

// 查询赛事列表
export function listCompetition(query) {
  return request({
    url: '/system/competition/list',
    method: 'get',
    params: query
  })
}

// 查询赛事详细
export function getCompetition(id) {
  return request({
    url: '/system/competition/' + id,
    method: 'get'
  })
}

// 新增赛事
export function addCompetition(data) {
  return request({
    url: '/system/competition',
    method: 'post',
    data: data
  })
}

// 修改赛事
export function updateCompetition(data) {
  return request({
    url: '/system/competition',
    method: 'put',
    data: data
  })
}

// 删除赛事
export function delCompetition(id) {
  return request({
    url: '/system/competition/' + id,
    method: 'delete'
  })
}

/**
 * 试题管理
 */
export function examlistInfo(query) {
  return request({
    url: '/system/competition/examlist',
    method: 'get',
    params: query
  })
}

// 试题下拉选加载
export function loadCompetitionQuestion() {
  return request({
    url: '/student/loadCompetitionQuestion',
    method: 'get'
  })
}

/**
 * 试题附件上传
 */
export function addExamQuestions(data) {
  return request({
    url: '/system/competition/addExamQuestions',
    method: 'post',
    data: data
  })
}
